package view

import (
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/os/glog"
	"github.com/gogf/gf/util/gconv"
)

func init() {
	glog.Debug("init view")
	v := g.View()
	v.BindFunc("mergeObj", MergeObj)
}

func MergeObj(args ...interface{}) interface{} {
	params := g.Map{}
	for k, v := range args {
		if k%2 == 0 {
			params[gconv.String(v)] = args[k+1]
		}
	}
	return params
}